package com.my.ctrl;

import com.my.dao.UserDao;
import com.my.entiy.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by Administrator on 2017/11/6.
 */
@RestController
@RequestMapping("/user")
public class UserCtrl {

    @Autowired
    private UserDao userDao;


    @RequestMapping("/add")
    @ResponseBody
    public Map add(User user){
        Map map = new HashMap();
        userDao.add(user);
        map.put("msg","ok");
        return map;
    }
}
